{extend name="index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">报工单管理</div>
    <div class="layui-card-body">
        <div class="layui-form">
            <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
            <script type="text/html" id="barTool">
                <a data-open='{:url("edit")}?id={{ d.id }}' class="layui-btn layui-btn-xs" title="编辑">编辑</a>
                <a href='{:url("delete")}?id={{ d.id }}' class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del">删除</a>
            </script>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
layui.use('yznTable', function() {
    var table = layui.yznTable;

    var init = {
        table_elem: '#currentTable',
        add_url: "{:url('add')}",
    };

    table.render({
        init: init,
        id:'currentTable',
        elem: '#currentTable',
        toolbar: ['refresh','add'],
        url: '{:url("index")}',
        search:true,
        cols: [
            [
                { field: 'id',width: 200, title: '编号'},
                { field: 'gongdan_nums', width: 200, align: 'left', title: '工单编号'},
                { field: 'product_nums', width: 200, align: 'left', title: '产品编号'},
                { field: 'product_title',width: 200, title: '产品名称' },
                { field: 'product_guige',width: 200, title: '产品规格' },
                { field: 'procedure_title',width: 200, title: '工艺名称' },
                { field: 'baogong',width: 200, title: '报工数量' },
                { field: 'wages_types', width: 200,title: '计价方式' },
                { field: 'prices', width: 200,title: '工资单价' },
                { field: 'wages', width: 200,title: '预计工资' },
                { field: 'good', width: 200,title: '良品数量' },
                { field: 'bad', width: 200,title: '次品数量' },
                { field: 'pro_user', width: 200,title: '生产人员' },
                { field: 'begin_time', width: 200,title: '报工开始时间' },
                { field: 'end_time', width: 200,title: '报工结束时间' },
                { field: 'approve', width: 200,title: '审批状态' },
                { fixed: 'right', width: 160, title: '操作', toolbar: '#barTool' }
            ]
        ],
        page: {}
    });
});
</script>
{/block}